// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-expect-error
// import addon from "./assets/hello.node";
// console.log(addon.hello()); // 输出: Hello from C++!

import * as path from "node:path";

let addon: any;

try {
  const addonPath = path.join(__dirname, "./assets/hello.node");
  console.log("test:zuoyu:path", addonPath);
  process.dlopen(module, addonPath);
  addon = module.exports;
  console.log("addon 加载成功:", addon);
} catch (error) {
  console.error("加载 addon 失败:", error);
}

export default addon;
